
function start(){
	
	
	
	var button = document.getElementById("show_meWhile");
	button.addEventListener("click", printWhile, false);
	
}

function printWhile(){
	
	window.alert("while");
	
	
	var punkt = document.getElementById("wh");
	
	window.alert("dowhile");
	var text;
	var counter = 1;
	text="";
	text=text+"<ul>"
	
	
	while(counter<6)
		{
			text=text+"<li>"+counter+"</li>";
			//document.writeln("<li>"+counter+"</li>")
			counter++;
		}
	
	text = text+"</ul>";
	//document.writeln("</ol>");
	/**/
	
	punkt.innerHTML=text;

}



function beginning(){
	
	
	var button = document.getElementById("show_meDoWhile");
	button.addEventListener("click", printDoWhile, false);
	
}


function printDoWhile(){
	
	
	var punkt = document.getElementById("dwh");
	
	window.alert("dowhile");
		var text;
		var counter = 1;
		text="";
		text=text+"<ol>"
		//document.writeln("<ol>");
		do
		{
			text=text+"<li>"+counter+"</li>";
			//document.writeln("<li>"+counter+"</li>")
			counter++;
		
		} while(counter<6)
		//document.writeln("</ol>");
		text = text+"</ol>"
		punkt.innerHTML=text;
}

/*document.onload = start();*/

window.addEventListener("load", start, false);
window.addEventListener("load", beginning, false);

/*document.onload= pelnoletni();*/




function processLinks()
{
   var linksList = document.links; // get the document's links
   var contents = "<ul>";

   // concatenate each link to contents
   for ( var i = 0; i < linksList.length; ++i )
   {
      var currentLink = linksList[ i ];
      contents += "<li><a href='" + currentLink.href + "'>" + 
         currentLink.innerHTML + "</li>";
   } // end for

   contents += "</ul>";
   document.getElementById( "links" ).innerHTML = contents;
} // end function processLinks

window.addEventListener( "load", processLinks, false );